<h1>Listing colors</h1>

<table>
  <tr>
    <th>顺序</th>
    <th>名称</th>
    <th>排序</th>
    <th>描述</th>
    
  </tr>
  
  <% @colors.each do |color| %>
    <tr>
      <td><%=h color.name %></td>
      <td><%=h color.description %></td>
      <td><%=h color.sort %></td>
      <td>
        <%= link_to_remote((image_tag "/images/sort_up.jpg" ,:size => "10x15"),:url=>color_sort_ajax_path(:color_id => color.id,:sort => "up"),:method => :get,:before => "disabled_page('true');",:complete => "disabled_page('false');")%>
        <%= link_to_remote((image_tag "/images/sort_down.jpg",:size => "10x15"),:url=>color_sort_ajax_path(:color_id => color.id,:sort => "down"),:method => :get,:before => "disabled_page('true');",:complete => "disabled_page('false');") %>
      </td>
      <td><%= link_to 'Show', color %></td>
      <td><%= link_to 'Edit', edit_color_path(color) %></td>
      <td><%= link_to 'Destroy', color, :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <% end %>
</table>

<br />
<h1>New color</h1>

<% form_for(@color) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :description %><br />
    <%= f.text_field :description %>
  </p>
  <p>
    <%= f.submit 'Create' %>
  </p>
<% end %>

<%= link_to 'New color', new_color_path %>